/**
 * Recupération de payload
 *
 */

#include  "rtp.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>

rtp_hdr_t *entete_RTP ;

int recup_paquetRTP(char * trame, int length,char * payloadRTP ){


	int i ;
	// HEADER (12 octet)

	//entete_RTP->version =trame ;		/*Version*/
	//entete_RTP->p =trame+2;				/*padding*/
	//entete_RTP->x =trame+3;             /*exchange*/
	//entete_RTP->cc =trame+4;            /*contributer counter */
	//entete_RTP->m =trame+8;             /*marker*/
	//entete_RTP->pt=trame+9;             /*Payload Type*/
	//entete_RTP->seq=trame+16;           /*Sequence Number*/
	//entete_RTP->ts =trame+32; 			/*timestamp*/
	//entete_RTP-> ssrc= trame +64;       /* Synchronisation source (SSCR) identifier*/

	entete_RTP = (rtp_hdr_t *)trame;
	printf("%d \n",entete_RTP->version );

	// copy du PAYLOAD
	memcpy(payloadRTP,trame+12*8,length-12*8);

	return(0);

}

	/*
	 *
	 */
	int getSequenceNumber(){
		return entete_RTP->seq ;
	}
	/*
	 *
	 */
	int getTimeStamp(){
		return entete_RTP->ts;
	}
	/*
	 *
	 */
	int getMark(){
		return entete_RTP->m ;
	}


